﻿<UserControl x:Class="CannedHeater.View.StatusPanelView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Converters="clr-namespace:CannedHeater.View.Converters"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">

    <!-- DataContext set from either ControlView or StatisticsView, both use same view -->
    
    <!-- Styles could be added for cleaner code -->
    
    <UserControl.Resources>
        <Converters:TemperatureConverter x:Key="tempConverter" />
    </UserControl.Resources>

    <Grid x:Name="RootGrid" Background="Transparent">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <Border BorderBrush="White" BorderThickness="1" Grid.Column="0">
            <TextBlock Text="Temp in." VerticalAlignment="Center" TextAlignment="Center"/>
        </Border>
        <Border BorderBrush="White" BorderThickness="1" Grid.Column="1">
            <TextBlock Text="Temp out." VerticalAlignment="Center" TextAlignment="Center"/>
        </Border>
        <Border Padding="4,0,4,0" BorderBrush="White" BorderThickness="1" Grid.Column="2">
            <TextBlock Text="Heater temp." VerticalAlignment="Center" TextAlignment="Center"/>
        </Border>
        <Border BorderBrush="White" BorderThickness="1" Grid.Column="3">
            <TextBlock Text="Air flow:" VerticalAlignment="Center" TextAlignment="Center"/>
        </Border>

        <Border BorderBrush="White" BorderThickness="1" Grid.Row="1" Grid.Column="0">
            <TextBlock Text="{Binding IndoorTemp, Converter={StaticResource tempConverter}}" HorizontalAlignment="Center" FontSize="30"/>
        </Border>
        <Border BorderBrush="White" BorderThickness="1" Grid.Row="1" Grid.Column="1">
            <TextBlock Text="{Binding OutdoorTemp, Converter={StaticResource tempConverter}}" HorizontalAlignment="Center" FontSize="30"/>
        </Border>
        <Border BorderBrush="White" BorderThickness="1" Grid.Row="1" Grid.Column="2" >
            <TextBlock Text="{Binding SolarHeaterTemp, Converter={StaticResource tempConverter}}" HorizontalAlignment="Center" FontSize="30"/>
        </Border>
        <Border BorderBrush="White" BorderThickness="1" Grid.Row="1" Grid.Column="3" >
            <TextBlock Text="{Binding AirFlow, Converter={StaticResource tempConverter}}" HorizontalAlignment="Center" FontSize="30"/>
        </Border>
    </Grid>
</UserControl>
